package com.dfrz;

import com.dfrz.entity.HelloWorld;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {
    public static void main(String[] args) {
        //在加载配置文件的时候就会去创建对象(不严谨的...)
        ApplicationContext ctx = new ClassPathXmlApplicationContext("spring01/applicationContext.xml");
        HelloWorld helloWorld = (HelloWorld) ctx.getBean("helloWorld");
        System.out.println(helloWorld);
        System.out.println(helloWorld.getMessage());
    }
}
